Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errcheck related to type assertion #654

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

bmf-san
Copy link
Contributor

@bmf-san bmf-san commented Feb 1, 2025

Description

I noticed that errcheck was returning an error by running make lint.
It seems to be caused by missing return value checks in a type assertion.

Error return value is not checked (errcheck)

Steps to Reproduce

make lint

What I Did

I addressed the root cause of the errcheck issue by adding conditional branching to the type assertion.

I decided to keep the function signature the same.

Although ignoring the error could be an option to avoid redundant error handling, I decided to handle it properly rather than ignoring it carelessly.

What I confirmed

  • The error disappeared with make lint
  • The test cases for the changed parts passed

Others

This is my first PR to tbls.
I often use tbls because they are easy to use and useful.
Thanks for tbls. :D

@k1LoW
Copy link
Owner

k1LoW commented Feb 1, 2025

@bmf-san Thank you!!!

@k1LoW k1LoW merged commit 84baa5f into k1LoW:main Feb 1, 2025
3 checks passed
@github-actions github-actions bot mentioned this pull request Jan 27, 2025
@bmf-san bmf-san deleted the fix/linter-errcheck branch February 1, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants